/**
*  \file var_tbl.c
*
*  \brief
*
*  \author Dajin Li  <dajin.li@linde-.de>
*
*
*/

/*===============================================[ private includes  ]================================================*/
#include "../xmc4500/types_local.h"

#include "var_tbl.h"



/*===============================================[ private defines   ]================================================*/

/*===============================================[ private datatypes ]================================================*/

/*===============================================[ private variables ]================================================*/
static s16 first_variable = {0};
static s16 last_variable = {0};

/*===============================================[ public variables ]================================================*/
char software_id[13] = {0};
char software_id_first_start[13] = {0};


char hardware_id[16]      = "01234567890";
char last_part_number[16] = "012345678901";
char part_number[16]      = "0123456789012";
char serial_number[16]    = "0123456789013";
char ecu_name[16]         = "000000000000000";


u32 software_version = 3;
u16  diag_version;
u16 brand_id;
u8 software_module = 0x00; // 0x01, applicaiton, 0x00 bootblock, 0x05 KudOS,


const s16 MAX_KWP_ECU_OBJECT_DEF = 11;

kwp_data_st kwp_ecu_params[] = 
{
  { &(hardware_id),              0x0F,     0,    0x80,    0, 0, 0 },      // 0,  hardware id
  { &(software_id_first_start),  0x0C,     0,    0x81,    0, 0, 0 },      // 1,  application software id
  { &(software_version),         0x02,     0,    0x84,    0, 0, 0 },      // 2,  software version
  { &(ecu_name),                 0x0F,     0,    0x85,    0, 0, 0 },      // 3,  ECU name,
  { &(software_id),              0x0C,     0,    0x86,    0, 0, 0 },      // 4,  boot software id
  { &(diag_version),             0x02,     0,    0x87,    0, 0, 0 },      // 5,  diag version
  { &(serial_number),            0x0F,     0,    0x88,    0, 0, 0 },      // 6,  hardware serial number
  { &(last_part_number),         0x0F,     0,    0x89,    0, 0, 0 },      // 7,  last part number
  { &(software_module),          0x01,     0,    0x8A,    0, 0, 0 },      // 8,  software modules,
  { &(first_variable),           0x00,     0,    0x8B,    0, 0, 0 },      // 9,  reserved
  { &(first_variable),           0x00,     0,    0x8C,    0, 0, 0 },      // 10, reserved
  { &(last_variable),            0,        0,    0,       0, 0, 0 }       //
};

const s16 MAX_KWP_DATA_OBJECT_DEF = 2;

kwp_data_st kwp_data_params[] = 
{
     // Var              attr      fram_addr   id      min    max       default
    { &(part_number),    0x880F,     0x000E,   0x00,    0,     0,        0,    },// 0,  part number
    { &(brand_id),       0x8802,     0x0036,   0x03,    0,     0,        0,    },// 1,  brand_id
    { &(hardware_id),    0x880B,     0x0002,   0x19,    0,     0,        0,    },// 2,  hardware_id

    { &(last_variable),  0,          0,		   0,	    0,     0,        0,    } // 2   null
};  
/*===============================================[ private functions ]================================================*/

                                                                                                    
/*================================================[ inline functions ]================================================*/

/*================================================[ public functions ]================================================*/

/***********************************************************************************************************************
*                             Copyright 2016 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/

